import socket
localip = socket.gethostbyname(socket.gethostname())
print "local ip %s" % localip

ipList = socket.gethostbyname_ex(socket.gethostname())
for i in ipList:
    if i != localip:
        print "external ip %s" % i
